package com.sihai.ehr.service;

import org.hibernate.Query;
import org.hibernate.Session;

import com.sihai.core.DynamicQuery;
import com.sihai.core.Limit;
import com.sihai.core.LimitedList;
import com.sihai.core.QueryCreator;
import com.sihai.core.Sorter;
import com.sihai.ehr.model.biz.EmployeeinfoWork;
import com.sihai.ehr.model.biz.SalaryCustom;
import com.sihai.ehr.model.biz.SalaryCustomConfig;
import com.sihai.ehr.model.biz.SalaryCustomDetail;
import com.sihai.ehr.model.sys.SalaryFrameworkEnum;

/**
 * 自定义薪资架构管理服务
 * 
 * @author henry
 * 
 */
public interface SalaryCustomService {
	/**
	 * 根据社保编号获取社保信息
	 * 
	 * @param id
	 * @return
	 */
	SalaryCustom get(Long id);

	/**
	 * 保存对象
	 * 
	 * @param structure
	 */
	void save(SalaryCustom custom);

	/**
	 * 删除自定义薪资架构信息
	 * 
	 * @param ids
	 */
	void deleteCustoms(String ids);

	/**
	 * 删除项目细节
	 * 
	 * @param structId
	 */
	void deleteCustomDetails(Long customId);

	/**
	 * 获取信息列表
	 * 
	 * @param organizationId
	 * @param limit
	 * @param sorter
	 * @return
	 */
	LimitedList<SalaryCustom> find(Long organizationId, Limit limit, Sorter sorter);

	/**
	 * 获取细节信息
	 * 
	 * @param customid
	 * @param frameworkEnum
	 * @return
	 */
	SalaryCustomDetail getCustomDetailByIdAndLnkType(Long customid, SalaryFrameworkEnum frameworkEnum);

	/**
	 * 
	 * @param workId
	 * @param limit
	 * @param sorter
	 * @return
	 */
	LimitedList<SalaryCustomConfig> getSalaryCustomConfigByWorkId(Long workId, Limit limit, Sorter sorter);

	// add.wxn
	// 查找某个自定义薪资架构已设置的人员列表
	LimitedList<EmployeeinfoWork> findCustomHasSetUsers(Long customId, Limit limit, Sorter sorter) throws Exception;

	// 查找某个自定义薪资架构未设置的人员列表
	LimitedList<EmployeeinfoWork> findCustomUnSetUsers(Long customId, Long organizationId, Long orgId, Long dutyId, Long gradeId, Long gradeLevelId, Float workYearStart,
			Float workYearEnd, Limit limit, Sorter sorter) throws Exception;

	// 添加人员到自定义架构
	void addUserToCustom(Long customId, String[] workIds);

	// 从自定义架构中删除人员
	void deleteUserFromCustom(Long customId, String workIds);

	/**
	 * 获取自定义设定的人数
	 * 
	 * @param customId
	 * @return
	 */
	Long getTotalCountBySalaryCustomId(Long customId);
}
